home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / ObserveTest / Controller.m < prev    next >
Text File  |  1995-06-12  |  1KB  |  45 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "Controller.h"
  5. #import "ObserveDispatch.h"
  6.  
  7. #import <appkit/Application.h>
  8.  
  9. @implementation Controller
  10.  
  11. - init
  12. {
  13.     [super init];
  14.     [NXApp setDelegate:self];
  15.  
  16.     return self;
  17. }
  18.  
  19. /*
  20.     Method: appDidInit:
  21.         By the time we get here, we can assume that all the nib instantiation
  22.         stuff has happened so that we can safely assume that all the instance
  23.         variables have been set.
  24. */
  25.  
  26. - appDidInit:sender
  27. {
  28.     printf("AppDidInit:\n");
  29.  
  30.     // The following three lines make sure that setIntValue: will be called
  31.     // on each of the observing cells whenever the main cell takes a new
  32.     // int value from the slider.
  33.     [mainCell addObserver:cell1 forAction:"takeIntValueFrom:"];
  34.     [mainCell addObserver:cell2 forAction:"takeIntValueFrom:"];
  35.     [mainCell addObserver:cell3 forAction:"takeIntValueFrom:"];
  36. /*
  37.     [mainCell addObserver:cell1 forAction:"setIntValue:"];
  38.     [mainCell addObserver:cell2 forAction:"setIntValue:"];
  39.     [mainCell addObserver:cell3 forAction:"setIntValue:"];
  40. */    
  41.     return self;
  42. }
  43.  
  44. @end
  45.